package com.longer.demo.framework.reponse;

import lombok.Data;

/**
 * @program: demo
 * @description:
 * @author: SunBiaoLong
 * @create: 2019-01-07 20:12
 **/
@Data
public class CommonResponse {
	/**
	 * success或者fail
	 */
	private String status;
	/**
	 * status=success,data返回正确信息
	 * status=fail ,data返回通用的错误码
	 */
	private Object data;


	public static CommonResponse create(Object data) {
		return CommonResponse.create("success", data);
	}

	public static CommonResponse create(String status, Object data) {
		CommonResponse commonResponse = new CommonResponse();

		commonResponse.status = status;

		commonResponse.data = data;
		return commonResponse;
	}
}
